package com.cc8w.controller;

import com.cc8w.entity.UserEntity;
import com.cc8w.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("index")
public class IndexController {

    @Autowired
    private UserService userService;

    @RequestMapping("index.do")
    public @ResponseBody UserEntity index(){
        System.out.println("111");
        //获取用户数据
        UserEntity user = userService.getUser();
        System.out.println(user);
        return user;
    }
    


    @RequestMapping("test01.do")
    public String test01(){
        System.out.println("111");
        //获取用户数据
        UserEntity user = userService.getUserPage();
        System.out.println(user);
        return "index/test01";
    }

}
